home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Applications / MacPerl 5.0.3 / MacCrypt / src / cryptXCMD.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-02  |  570 b   |  31 lines  |  [TEXT/MMCC]

  1. #include <A4Stuff.h>
  2. #include <Memory.h>
  3. #include <HyperXCmd.h>
  4. #include <string.h>
  5.  
  6. char * crypt();
  7.  
  8. pascal void main(XCmdPtr paramPtr)
  9. {
  10.     char * result;
  11.     long int oldA4;
  12.     
  13.     if (paramPtr->paramCount != 2) {
  14.         result = "Wrong # of arguments to crypt()";
  15.         
  16.         goto done;
  17.     }
  18.     oldA4 = SetCurrentA4();    
  19.     HLock(paramPtr->params[0]);
  20.     HLock(paramPtr->params[1]);
  21.     result = crypt(*paramPtr->params[0], *paramPtr->params[1]);
  22.     HUnlock(paramPtr->params[0]);
  23.     HUnlock(paramPtr->params[1]);
  24.     SetA4(oldA4);
  25. done:
  26.     PtrToHand(result, ¶mPtr->returnValue, strlen(result) + 1);
  27. }
  28.  
  29.  
  30.  
  31.